<?php
if (!defined('INDEX')) {
    exit('Access Denied');
}
define('VIEW_PAGE', 1);
//网站前台公告
function dd_article($duoduo,$cid,$num=4,$fileds='id,title'){
	$article=$duoduo->select_all('article',$fileds,'cid="'.$cid.'" and del=0 order by sort asc,id desc limit 0,'.$num);
	return $article;
}

$slides=$duoduo->select_all('slides','*','cid="1" order by sort=0 asc,sort asc,id desc');
$chongzhi_url=$ddTaoapi->tdj_zujian(1,$dduser['id']);
include(DDROOT.'/comm/mall.class.php');
$mall_class=new mall($duoduo);
$num=15;
$malls=$mall_class->index($num,$paipai_arr);
$article_2=dd_article($duoduo,26,4);
//友情链接
$yqlj=dd_link($duoduo,30,0);

//合作伙伴
$hzhb=dd_link($duoduo,30,1);

$ajax_load_num=$dd_tpl_data['ajax_load_num'];

$bankuai=$duoduo->select_all('bankuai','id,title,code,bankuai_tpl,web_cid,yugao,yugao_time,huodong_time',"tuijian=1 and status=1 and del=0 ORDER BY sort=0 ASC,sort asc,id desc");
$t=array();
foreach($bankuai as $key=>$vo){
	if($key==0){
		if($vo['huodong_time']){
			$vo['huodong_etime']=strtotime(date('Y-m-d '.$vo['huodong_time'].":00:00",TIME))+24*3600;
		}
		$first_bankuai=$vo;
		$web_cid=$vo['web_cid'];
	}
	if(!in_array($vo['bankuai_tpl'],$t)){
		$css[]=TPLURL."/goods/".$vo['bankuai_tpl']."/css/list.css";
		$t[]=$vo['bankuai_tpl'];
	}
}
$web_cid=unserialize($web_cid);
if($web_cid){
	$where="id in(".implode(',',$web_cid).")";
}else{
	$where=" tag='goods' ";
}
if(!empty($web_cid)){
	$goods_type=$duoduo->select_all("type","id,title",$where."  order by sort=0 asc,sort asc,id desc");
}
$yugao_time=date('Y-m-d '.$first_bankuai['yugao_time'].":00");
if(strtotime($yugao_time)>TIME){
	$yugao_close=true;
}
?>

